#ifndef _ENTITY_H_
#define _ENTITY_H_

#include "TextureManager.h"

enum objt
{
	PLAYER,
	MOB,
	INTERACTABLE,
	PARTICLE,
};

namespace Engine
{
	class Entity
	{
	private:
		int id;
		std::string name;
		bool visible;
		bool alive;
		int objectType;
		int lifetimeLength;
		sf::Clock lifetimeTimer;
	public:
		Entity();
		virtual ~Entity() { };
		virtual void move() = 0;
		virtual void animate() = 0;
		virtual void draw(sf::RenderWindow &window) = 0;

		//NEEDS TO BE OVERRIDDEN
		virtual void cleanUp();
		///////////////////////////

		//some events...
		virtual void onCollide(Entity &entity) = 0;
		virtual void onUse(Entity &entity) = 0;

		void setID(int value) { id = value; }
		int getID() { return id; }

		std::string getName() { return name; }
		void setName(std::string value) { name = value; }

		bool getVisible() { return visible; }
		void setVisible(bool value) { visible = value; }

		bool getAlive() { return alive; }
		void setAlive(bool value) { alive = value; }

		int getLifetime() { return lifetimeLength; }
		void setLifetime(int milliseconds)
		{
			lifetimeLength = milliseconds; lifetimeTimer.Restart();;
		}

		bool lifetimeExpired() 
		{
			if(lifetimeTimer.GetElapsedTime().AsMilliseconds() >lifetimeLength) return true;
			else return false;
		}

		int getObjectType() { return objectType; }
		void setObjectType(int value) { objectType = value; }
	};
}

#endif